/**
 * @作者 chengxinxiaofeng
 * @时间 2019年7月15日10:30:20
 */
package com.chinaunicom.tour.sys.entity.base;

import java.util.UUID;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

@MappedSuperclass
public abstract class BaseEntity {

    public String id;

    @Id
    @Column(name = "id", length = 32)
    public String getId() {
        if (id == null)
            id = UUID.randomUUID().toString().replace("-", "");
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

}
